package test1230pm;

public class Test05 {
    public static void main(String[] args) {
        // (5)设计一个雇员类和部门类
        // 场景：雇员张三在开发部工作、雇员张三调换部门换成市场部
        // 要求：使用Java语言表示出上述场景
        Bumen kaifa = new Bumen("开发部");
        Bumen shichang = new Bumen("市场部");
        Guyuan zhangsan = new Guyuan("张三", kaifa);
        System.out.println(zhangsan);
        zhangsan.bumen = shichang;
        System.out.println(zhangsan);
    }
}
class Bumen{
    String bumenName;

    public Bumen() {
    }

    public Bumen(String bumenName) {
        this.bumenName = bumenName;
    }

    public String getBumenName() {
        return bumenName;
    }

    public void setBumenName(String bumenName) {
        this.bumenName = bumenName;
    }

    @Override
    public String toString() {
        return "Bumen{" +
                "bumenName='" + bumenName + '\'' +
                '}';
    }
}
class Guyuan{
    String guyuanName;
    Bumen bumen;
    public Guyuan() {
    }

    public Guyuan(String guyuanName, Bumen bumen) {
        this.guyuanName = guyuanName;
        this.bumen = bumen;
    }

    public String getGuyuanName() {
        return guyuanName;
    }

    public void setGuyuanName(String guyuanName) {
        this.guyuanName = guyuanName;
    }

    public Bumen getBumen() {
        return bumen;
    }

    public void setBumen(Bumen bumen) {
        this.bumen = bumen;
    }

    @Override
    public String toString() {
        return "Guyuan{" +
                "guyuanName='" + guyuanName + '\'' +
                ", bumen=" + bumen +
                '}';
    }
}
